package com.whz.builder;

/**
 * @Author: sinosoft
 * @Description:
 * @Date: Create in 20:07 2021/4/28
 * @Modified By:
 */
public class Calzone extends Pizza {
    /*指定酱汁内置还是外置*/
    private final boolean sauceInside;
    public static class Builder extends Pizza.Builder<Builder> {
        /*默认内置*/
        private boolean sauceInside = false;

        /*外置*/
        public Builder sauceInside() {
            sauceInside = true;
            return this;
        }
        @Override
        public Calzone build() {
            return new Calzone(this);
        }
        @Override
        protected Builder self() {
            return this;
        }
    }
    private Calzone(Builder builder) {
        super(builder);
        sauceInside = builder.sauceInside;
    }

    @Override
    public String toString() {
        return "Calzone {" +
                " 酱汁内置还是外置 = " + sauceInside +
                ", 配方 = " + toppings +
                '}';
    }
}
